
import React, { Component } from 'react';
import {withRouter} from "react-router-dom";

class Son extends Component {

    toParent=()=>{
        this.props.chuan("hello，我是儿子");
    }

    
    goReactRedux=()=>{

      console.log("Son:this.props",this.props);
      this.props.history.push("/Admin/ReactReduxDemo");
    }

  render() {
    return (
      <div>
        <h1>子组件</h1>
        <p>级别：{this.props.level}</p>
        <input type="button" value="传给父亲" onClick={this.toParent} />
        <input type='button' value="去react-redux【不能跳的】" onClick={this.goReactRedux} />
      </div>
    )
  }
}

export default withRouter(Son);